import java.util.Scanner;

public class Ex5_10{
	public static void main(String[] args){
		int count = 0;
		for (int n = 2; n < 1000; n++){
			if (isPrime(n)){
				System.out.printf("%4d", n);
				if (++count % 10 == 0)
					System.out.printf("\n");
			}
		}
	}

	public static boolean isPrime(int number){
		int i;
		for (i = 2; i <= number/2; i++)
			if (number % i == 0)
				break;
		if (i > number/2)
			return true;
		else
			return false;
	}
}
